package com.lijianlove.keeplearning.dr.support.annotation;

import com.lijianlove.keeplearning.dr.support.customize.DefaultProcessor;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Order(Ordered.HIGHEST_PRECEDENCE)
public @interface DR {
    /**
     * 有效日期，单位毫秒，默认永久有效
     *
     * @return
     */
    long expire() default 0;

    /**
     * 参与计算的二进制位，0:所有需要的字段 ; -1:不参与幂等
     *
     * @return
     */
    int calBit() default 0;

    /**
     * 处理方法
     *
     * @return
     */
    Class processor() default DefaultProcessor.class;


}
